package javaoo.j180.homework;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *  let  str = "get-element-by-id";改成驼峰命名 getElementById
 */
public class HomeWork_03 {
    public static void main(String[] args){
        String str = "get-element-by-id";
        Pattern p = Pattern.compile("-[a-z]");
        Matcher m = p.matcher(str);

        while (m.find()){
            char a = (char) (str.charAt(m.start()+1) - 32);
            String s = a + "";
            str = m.replaceFirst(s);
            m = p.matcher(str);
        }
        System.out.println(str);
    }
}
